Add tests for the infobar builder parser
authorMatthias Clasen <mclasen@redhat.com>
Mon, 27 Apr 2015 03:03:05 +0000 (23:03 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 27 Apr 2015 05:15:23 +0000 (01:15 -0400)
testsuite/gtk/Makefile.am
testsuite/gtk/ui/infobar1.expected [new file with mode: 0644]
testsuite/gtk/ui/infobar1.ui [new file with mode: 0644]
testsuite/gtk/ui/infobar2.expected [new file with mode: 0644]
testsuite/gtk/ui/infobar2.ui [new file with mode: 0644]
testsuite/gtk/ui/infobar3.expected [new file with mode: 0644]
testsuite/gtk/ui/infobar3.ui [new file with mode: 0644]
testsuite/gtk/ui/infobar4.expected [new file with mode: 0644]
testsuite/gtk/ui/infobar4.ui [new file with mode: 0644]
testsuite/gtk/ui/infobar5.expected [new file with mode: 0644]
testsuite/gtk/ui/infobar5.ui [new file with mode: 0644]

index 5d52a50e473c8e6b00f31db45580c7f4d81c45ef..1141ccf0f8b901e67407e02320f2ee5f89331e21 100644 (file)
@@ -214,6 +214,11 @@ test_ui =                                          \
        ui/filefilter8.ui ui/filefilter8.expected       \
        ui/filefilter9.ui ui/filefilter9.expected       \
        ui/filefilter10.ui ui/filefilter10.expected     \
+       ui/infobar1.ui ui/infobar1.expected             \
+       ui/infobar2.ui ui/infobar2.expected             \
+       ui/infobar3.ui ui/infobar3.expected             \
+       ui/infobar4.ui ui/infobar4.expected             \
+       ui/infobar5.ui ui/infobar5.expected             \
        $(NULL)
 
 EXTRA_DIST +=                          \
diff --git a/testsuite/gtk/ui/infobar1.expected b/testsuite/gtk/ui/infobar1.expected
new file mode 100644 (file)
index 0000000..ff43ca4
--- /dev/null
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/infobar1.ui b/testsuite/gtk/ui/infobar1.ui
new file mode 100644 (file)
index 0000000..26d667f
--- /dev/null
@@ -0,0 +1,17 @@
+<!-- test all valid infobar markup -->
+<interface>
+  <object class="GtkInfoBar">
+    <child>
+      <object class="GtkButton" id="button_cancel"/>
+    </child>
+    <child>
+      <object class="GtkButton" id="button_ok">
+        <property name="can-default">True</property>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-3">button_cancel</action-widget>
+      <action-widget response="ok">button_ok</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar2.expected b/testsuite/gtk/ui/infobar2.expected
new file mode 100644 (file)
index 0000000..ff66960
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 6
+.:8:38 Could not parse enum: `xyz'
diff --git a/testsuite/gtk/ui/infobar2.ui b/testsuite/gtk/ui/infobar2.ui
new file mode 100644 (file)
index 0000000..7379a68
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- invalid response value -->
+<interface>
+  <object class="GtkInfoBar">
+    <child>
+      <object class="GtkButton" id="button_cancel"/>
+    </child>
+    <action-widgets>
+      <action-widget response="xyz">button_cancel</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar3.expected b/testsuite/gtk/ui/infobar3.expected
new file mode 100644 (file)
index 0000000..d40e631
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 4
+.:8:48 attribute 'food' invalid for element 'action-widget'
diff --git a/testsuite/gtk/ui/infobar3.ui b/testsuite/gtk/ui/infobar3.ui
new file mode 100644 (file)
index 0000000..a469d76
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- invalid attribute -->
+<interface>
+  <object class="GtkInfoBar">
+    <child>
+      <object class="GtkButton" id="button_cancel"/>
+    </child>
+    <action-widgets>
+      <action-widget response="ok" food="egg">button_cancel</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar4.expected b/testsuite/gtk/ui/infobar4.expected
new file mode 100644 (file)
index 0000000..f4e1d2b
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:8:15 Unsupported tag for GtkInfoBar: <worbl>
diff --git a/testsuite/gtk/ui/infobar4.ui b/testsuite/gtk/ui/infobar4.ui
new file mode 100644 (file)
index 0000000..0730d5b
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- invalid element -->
+<interface>
+  <object class="GtkInfoBar">
+    <child>
+      <object class="GtkButton" id="button_cancel"/>
+    </child>
+    <action-widgets>
+      <worbl/>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar5.expected b/testsuite/gtk/ui/infobar5.expected
new file mode 100644 (file)
index 0000000..65dee44
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+Unhandled tag: <worbl>
diff --git a/testsuite/gtk/ui/infobar5.ui b/testsuite/gtk/ui/infobar5.ui
new file mode 100644 (file)
index 0000000..01bdcbb
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- invalid element -->
+<interface>
+  <object class="GtkInfoBar">
+    <child>
+      <object class="GtkButton" id="button_cancel"/>
+    </child>
+    <action-widgets>
+    </action-widgets>
+    <worbl/>
+  </object>
+</interface>